const app = getApp();
const https = require('../../utils/https');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    starCheckedImgUrl: '../../images/star1.png',
    starUnCheckedImgUrl: '../../images/star3.png',
    starMap: [
      '非常差',
      '差',
      '一般',
      '好',
      '非常好',
    ],
    starscores: [],
    service_start: 5,
    major_start: 5,
    clothing_start: 5,
    attitude_Start: 5,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    if (options && options.order_sn != '') {
      that.setData({
        order_sn: options.order_sn
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getBookCommonInfo();
  },
  /**
   * @xk 获取评论
   * @param {} res 
   */
  getBookCommonInfo: function(res){
    var that = this,
        order_sn = this.data.order_sn;
    https.post('getBookCommonInfo',{order_sn: order_sn},false,'加载中').then(res=>{
      that.setData({
        service_start: res.service_start,
        major_start: res.major_start,
        clothing_start: res.clothing_start,
        attitude_Start: res.attitude_Start,
        content: res.content
      })
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },
})